﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CRUDProduct.ascx.cs" Inherits="CMS.UserControl.CRUDProduct" %>
<h3 class="title">Tìm kiếm thông tin sản phẩm</h3>
<div class="block_update">
    <table cellspacing="2" cellpadding="5">
        <tr>
            <td class="tdtitle">Chuyên mục</td>
            <td>
                <asp:DropDownList CssClass="textinput" ID="ddlSection" Width="300px" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSection_SelectedIndexChanged"></asp:DropDownList>
            </td>
            <td class="tdtitle">Tình trạng</td>
            <td>
                <asp:DropDownList CssClass="textinput" ID="ddlStatus" Width="300px" runat="server">
                    <asp:ListItem Value="-1" Text="Tất cả"></asp:ListItem>
                    <asp:ListItem Value="1" Text="Đang hiển thị"></asp:ListItem>
                    <asp:ListItem Value="0" Text="Đang ẩn"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="tdtitle">Thể loại</td>
            <td>
                <asp:DropDownList CssClass="textinput" ID="ddlCategory" Width="300px" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged"></asp:DropDownList>
            </td>
            <td class="tdtitle">Tên sản phẩm</td>
            <td>
                <asp:TextBox ID="txtName" CssClass="textinput" Width="278px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdtitle">Số lượng</td>
            <td>
                <asp:TextBox ID="txtQuantity" CssClass="textinput" Width="278px" runat="server"></asp:TextBox>
            </td>
            <td colspan="2">
                <asp:Button ID="btnFilter" CssClass="button_submmit horizontal_right" runat="server" Text="Lọc danh sách" OnClick="btnFilter_Click" />
            </td>
        </tr>
    </table>
</div>
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
<asp:GridView ID="grvProduct" runat="server" Width="902px" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" AllowPaging="True" AllowSorting="True">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:TemplateField ItemStyle-CssClass="center">
            <ItemTemplate>
                <asp:CheckBox ID="chkSelect" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Hình ảnh">
            <ItemTemplate>
                <div class="icon_product">
                    <img src="<%#Eval("Image") %>" title="<%#Eval("Name") %>" />
                </div>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Name" HeaderText="Tên sản phẩm" />
        <asp:BoundField DataField="SectionName" HeaderText="Chuyên mục" />
        <asp:BoundField DataField="CategoryName" HeaderText="Thể loại" />
        <asp:TemplateField HeaderText="Giá bán" ItemStyle-CssClass="right">
            <ItemTemplate>
                <%#Eval("CurrentPrice","{0:0,000}") %>
            </ItemTemplate>
            <ItemStyle CssClass="center"></ItemStyle>
        </asp:TemplateField>
        <asp:BoundField DataField="Quantity" ItemStyle-CssClass="right" HeaderText="Số lượng" />
        <asp:TemplateField HeaderText="Active" ItemStyle-CssClass="center">
            <ItemTemplate>
                <asp:ImageButton ID="btnActive" runat="server" OnClick="btnActive_Click" ImageUrl='<%# Convert.ToBoolean(Eval("Enable")) ? "~/Content/images/active.png" : "~/Content/images/deactive.png" %>' /><%--OnClientClick="return confirm('Bài đăng sẽ bị ẩn trên trang chủ. Bạn có muốn tiếp tục');"--%>
                <input type="hidden" value="<%#Eval("ProductId") %>" name="txtProductId" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <a href="ChannelProduct.aspx?action=pedit&pid=<%#Eval("ProductId") %>">
                    <img src="Content/images/edit.png" alt="Edit" title="Sửa" />
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <a href="ChannelProduct.aspx?action=pdelete&pid=<%#Eval("ProductId") %>">
                    <img src="Content/images/del.png" alt="Delete" title="Xóa" />
                </a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#CCCC99" />
    <HeaderStyle BackColor="#094794" CssClass="center" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
    <RowStyle BackColor="#F7F7DE" />
    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#FBFBF2" />
    <SortedAscendingHeaderStyle BackColor="#848384" />
    <SortedDescendingCellStyle BackColor="#EAEAD3" />
    <SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
